package com.example.demo.Results;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class BasePage {
    @ApiModelProperty(value = "页码")
    private static Integer pageNo = 1;
    @ApiModelProperty(value = "每页条数")
    private static Integer pageSize = 10;

    public static Page getPage(Integer pageNoReq, Integer pageSizeReq) {
        if (pageNoReq != null) {
            pageNo = pageNoReq;
        }
        if (pageSizeReq != null) {
            pageSize = pageSizeReq;
        }
        //System.out.println(pageNo);
        //System.out.println(pageSize);
        //参数一是当前页，参数二是每页个数
        return new Page(pageNo, pageSize);
    }
}
